home *** CD-ROM | disk | FTP | other *** search
- on clearAnswers
- set the text of member "PrintAllAnswers" to EMPTY
- end
-
- on gatherAllParts
- global gAllPart_1, gAllPart_2, gAllPart_3, gMasterData, gAllParts, gNoteArchive
- if voidp(gAllPart_1) then
- set gAllPart_1 to "Part 1 not completed by user." & RETURN & "--------------------------------------------------"
- end if
- if voidp(gAllPart_2) then
- set gAllPart_2 to "Part 2 not completed by user." & RETURN & "--------------------------------------------------"
- end if
- if voidp(gAllPart_3) then
- set gAllPart_3 to "Part 3 not completed by user." & RETURN & "--------------------------------------------------"
- end if
- set gAllParts to "Workplace Effectiveness, Dealing with Change" & RETURN & "Exploration begun at " & getTimeDate(gMasterData) & RETURN & RETURN
- put gAllPart_1 & RETURN & RETURN & gAllPart_2 & RETURN & RETURN & gAllPart_3 & RETURN & RETURN after gAllParts
- if voidp(gNoteArchive) then
- put "No notes were taken during this session." & RETURN after gAllParts
- else
- put "The following are the notes you entered during this session:" & RETURN & gNoteArchive & RETURN after gAllParts
- end if
- set the text of member "PrintAllAnswers" to gAllParts
- end
-
- on writeScoreFile
- global gAllParts, gSep
- set ScoreFN to getOSDirectory() & gSep & "score.txt"
- put "ScoreFN = " && ScoreFN
- set writeScObj to new(xtra("fileio"))
- openFile(writeScObj, ScoreFN, 2)
- set wrStatus to status(writeScObj)
- case wrStatus of
- 0:
- writeString(writeScObj, gAllParts)
- set wrStatus to status(writeScObj)
- if wrStatus <> 0 then
- displayErrorMsg("attempting to write your Score information.", wrStatus, writeScObj)
- end if
- closeFile(writeScObj)
- set writeScObj to 0
- alert("The file" && QUOTE & "score.txt" & QUOTE && "containing your data has been saved to the computer startup disk.")
- (-43), (-37):
- createFile(writeScObj, ScoreFN)
- set wrStatus to status(writeScObj)
- if wrStatus <> 0 then
- displayErrorMsg("attempting to write your Score information(CREerr).", wrStatus, writeScObj)
- end if
- openFile(writeScObj, ScoreFN, 2)
- set wrStatus to status(writeScObj)
- if wrStatus <> 0 then
- displayErrorMsg("attempting to write your Score information.(CRE/OPNerr)", wrStatus, writeScObj)
- end if
- setFinderInfo(writeScObj, "TEXTTTXT")
- writeString(writeScObj, gAllParts)
- set wrStatus to status(writeScObj)
- if wrStatus <> 0 then
- displayErrorMsg("attempting to write your Score information.", wrStatus, writeScObj)
- end if
- closeFile(writeScObj)
- set writeScObj to 0
- alert("The file" && QUOTE & "score.txt" & QUOTE && "containing your data has been saved to the computer startup disk.")
- otherwise:
- displayErrorMsg("attempting to write your Score information. The error:", wrStatus, writeScObj)
- end case
- end
-
- on displayErrorMsg whatMsg, whatError, whatObj
- alert("An error has occured" && whatMsg && "The error:" && error(whatObj, whatError))
- end
-